package com.massa.caronafacil.activities;

import com.massa.caronafacil.R;
import com.massa.caronafacil.TabsViewPagerApplication;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class MinhasCaronasActivity extends Activity implements OnClickListener {

	private Button criarCaronabutton;
	private Button alterarCaronasbutton;

    @Override
    protected final void onCreate(final Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        // Inflate the layout
        setContentView(R.layout.minhas_caronas_layout);
        
        criarCaronabutton = (Button) findViewById(R.id.buttonCriarCarona);
        criarCaronabutton.setOnClickListener(this);
        alterarCaronasbutton = (Button) findViewById(R.id.buttonAlterarCaronas);
        alterarCaronasbutton.setOnClickListener(this);
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
    }

    @Override
    protected final void onSaveInstanceState(final Bundle outState) {
        super.onSaveInstanceState(outState);
    }

    @Override
    public void onBackPressed() {
        super.onBackPressed();
    }

	@Override
	public void onClick(View v) {
        if (v != null) {
            switch (v.getId()) {
            case R.id.buttonCriarCarona:
                final Intent intentCriarCarona = new Intent(TabsViewPagerApplication.getAppContext(),
                        CriarCaronaActivity.class);
                startActivity(intentCriarCarona);
                break;
                
            case R.id.buttonAlterarCaronas:
                final Intent intentAlterarCaronas = new Intent(TabsViewPagerApplication.getAppContext(),
                        AlterarCaronasActivity.class);
                startActivity(intentAlterarCaronas);
                break;
            }
        }
	}
}
